<template>
  <eidt @submit="submit" :u="u"></eidt>
</template>
<script>
import eidt from "@/components/AddOrEidtUser";
export default {
  async created() {
    await this.$store.dispatch("users/getByIdUser", this.$route.params.id);
  },
  components: {
    eidt
  },
  computed: {
    u() {
      return this.$store.state.users.UserUpde;
    }
  },
  methods: {
    async submit(u) {
      await this.$store.dispatch("users/updeUser", u);
      this.$message({
        message: "修改用户成功！",
        type: "success",
        onClose: () => {
          this.$router.push({
            name: "user"
          });
        }
      });
    }
  }
};
</script>

